import React, {Component} from 'react';
import { Badge,Card,NoticeBar, Button,Scroller,Popup,Group, Field, Toast,NumberPicker, Context,SelectField, Dialog,Layer   } from 'saltui';

import HTab from "../../../Common/Tab";
import roomSettingMock from "../../mock/roomSettingMock";
import AddButton from  './AddButton'
import { Table, Column, HeaderCell, Cell } from 'rsuite-table';
import 'rsuite-table/lib/less/index.less'
import '../css/listTable.less'
/**
 * <List id  />
 */
export default class List extends React.Component {

  constructor(props) {
    super(props);
    this.state ={};
    this.state.id = this.props.id;

  }

  componentWillReceiveProps (nextProps) {

  }




  render(){
    return (
      <div className="t-FS14">
        <div className="demo-line setting-add">
          <AddButton  typeObj={this.props.typeObj} onChange = {this.props.onChange} id={this.props.id}  type={this.props.type} />
        </div>

        <Table height={420} data={this.props.data} className="H-Table">

          {
            this.props.columns.map((value,index) =>(
              <Column {...value.Column} key={index} >
                <HeaderCell  {...value.HeaderCell} >{value.HeaderCell.title}</HeaderCell>
                <Cell  {...value.Cell} />
              </Column>
            ))
          }


        </Table>

      </div>
    );
  }

}
